package com.example.administrator.shzs.parse;

import com.example.administrator.shzs.entity.User;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * 个人用户中心
 */

public class ParseUserData {

    public static User getUser (String json){
        User user = new User();
        try {
            JSONObject jsonObject = new JSONObject(json);
            user.setUserid(jsonObject.getString("userid"));
            user.setUsername(jsonObject.getString("username"));
            user.setPhone(jsonObject.getString("phone"));
            user.setPoint(jsonObject.getString("Point"));
            user.setPic(jsonObject.getString("pic"));

        } catch (JSONException e) {
            e.printStackTrace();
        }
        return user;
    }
}
